/* typehint:start */
const { Task } = require("../../../../../task/task");
/* typehint:end */

module.exports = (npc) => {
  let taskKey = 'primary/丰华村/止血草/1';

  let group = npc.dialogue.group('d3', {
    task: {
      id: taskKey,
      pick: true
    }
  });

  /** @type {Task} */
  let task = npc.root.task.getTask(taskKey);
  let isComplete = task.getIsComplete();
  let me = '村长，我找来了止血草。'

  if(isComplete){
    let s1 = group.section(me, '感谢感谢');

    s1.click = () => {
      npc.root.task.complete(taskKey, npc)
    }
  } else {
    let s1 = group.section(me, `你的止血草数量不够呀，这不是逗村长我吗。`);

    s1.click = () => {
      npc.setFavor(-10);
    }
  }

  return group;
}